package com.wtwd.campus.dao;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.wtwd.campus.entity.FenceInfo;
import com.wtwd.campus.entity.H5Fence;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

@Mapper
public interface FenceInfoMapper {
    //新增围栏
    Integer addFence(@Param("fenceInfo") FenceInfo fenceInfo);

    //条件查询围栏列表
    IPage<Map<String,Object>> getFenceInfoList(@Param("orgCode") String orgCode, @Param("name") String name, @Param("page") Page<Map<String,Object>> page);

    //修改围栏信息
    Integer modifyFenceInfo(@Param("fenceInfo") FenceInfo fenceInfo);

    //删除围栏信息
    Integer deleteFenceIfo(@Param("fenceId") Integer fenceId);

    //根据设备id获取所属于的围栏信息
    List<FenceInfo> getFenceInfoByDeviceId(@Param("deviceId") Integer deviceId);

    /**
     *     根据学生id查询围栏
     */
    List<FenceInfo> getFenceInfoListByStuId( @Param("stuId") Integer stuId);

    /**
     * 根据id查询围栏信息
     * @param id
     * @return
     */
    FenceInfo getFenceInfoById(Integer id);

    /**
     * 获取h5的围栏
     * @param deviceId
     * @return
     */
    List<H5Fence> getH5FenceByDeviceId(@Param("deviceId") Integer deviceId);

    /**
     * 根据id查询h5围栏
     * @param id
     * @return
     */
    H5Fence getH5FenceById(@Param("id") Integer id);

    /**
     * 根据客户id查询h5围栏
     * @param userId
     * @param id
     * @return
     */
    H5Fence getH5FenceByCusIdAndId(@Param("userId") Integer userId,@Param("id")Integer id);

    /**
     * 删除h5围栏
     * @param id
     * @return
     */
    Integer deleteH5FenceById(@Param("id")Integer id);

    /**
     * 根据设备imei获取h5的围栏
     * @param imei
     * @return
     */
    List<H5Fence> getH5FenceByImei(@Param("imei") String imei);

    /**
     * 根据围栏id修改h5围栏
     * @param data
     * @return
     */
    Integer modifyH5FenceById(@Param("data") H5Fence data);

    /**
     * 新增h5围栏
     * @param data
     * @return
     */
    Integer addH5Fence(@Param("data") H5Fence data);
}
